<?php

namespace common\models\myhtsq;

use common\models\BaseModel;

/**
 * Description of RevenueModel
 * 收入信息统一model
 * @author chenxc
 */
class RevenueModel extends BaseModel {

    public $revenue_id;
    public $contract_id;
    public $revenue_type;
    public $amount;
    public $created_by;
    public $modified_by;
    public $created_on;
    public $modified_on;
    public $income_code;
    public $begin_on;
    public $end_on;
    public $establish_time;
    public $add_type;
    public $recognized_type;
    public $unrecognized_bad_debt_amount;
    public $recognized_bad_debt_amount;
    public $kingdee_bad_debt_amount;
    public $maintain_remark;
    public $close_status;
    public $searchKey;
    public $pageIndex;
    public $pageSize;
    public $beginDate;
    public $endDate;
    public $establishDate;
    public $closeStatus;
    public $contractStatus;
    public $isCancelled;

    public $type;

    public function __construct($config = array()) {
        parent::__construct($config);
    }

    public function rules() {
        return [
            // 获取收入列表
            [['type','contractStatus','isCancelled'], 'string', 'on' => 'getRevenueListByPage'],
            [['closeStatus'], 'string', 'on' => 'getRevenueListByPage'],
            [['closeStatus'], 'default', 'value' => 1, 'on' => 'getRevenueListByPage'],
            [['beginDate', 'endDate','establishDate'], 'date', 'format' => 'php:Y-m-d', 'on' => 'getRevenueListByPage'],
            [['searchKey'], 'string', 'on' => 'getRevenueListByPage'],
            [['pageIndex'], 'integer', 'min' => 0, 'on' => 'getRevenueListByPage'],
            [['pageIndex'], 'default', 'value' => 0, 'on' => 'getRevenueListByPage'],
            [['pageSize'], 'integer', 'min' => 1, 'on' => 'getRevenueListByPage'],
            [['pageSize'], 'default', 'value' => 20, 'on' => 'getRevenueListByPage'],
            // 保存收入

        ];
    }

}
